# from django.test import TestCase

# Create your tests here.


def WePayJsApiReqsn(*args, **kwargs):
    """JSAPI下单"""
    url = "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi"
    method = "POST"
    query = None
    body = {
        "appid": "",  # 公众号的服务号APPID
        "mchid": "",  # 直连商户的商户号
        "description": "",  # 商品描述
        "out_trade_no": "",  # 商户系统内部订单号,只能是数字、大小写字母 6<x<32
        "notify_url": "",  # 通知地址
        "amount": {
            "total": 1,  # 订单总金额，单位为分
            "currency": "CNY",  # 人民币
        },
        "payer": {"openid": ""},  # 用户的Openid
    }

    # 返回值 预支付交易会话标识
    # r = {"prepay_id": "wx26112221580621e9b071c00d9e093b0000"}
    return True


def wePayH5ApiReqsn(*args, **kwargs):
    """H5API 下单"""
    url = "https://api.mch.weixin.qq.com/v3/pay/transactions/h5"
    method = "POST"
    query = None
    body = {
        "appid": "",
        "mchid": "",
        "description": "",
        "out_trade_no": "",
        "notify_url": "",
        "amount": {
            "total": 1,  # 订单总金额，单位为分
            "currency": "CNY",  # 人民币
        },
        "scene_info": {"payer_client_ip": "192.168.0.12", "h5_info": {"type": "Wap"}},
    }

    # 返回值 支付跳转链接
    # r = {
    #     "h5_url": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx2916263004719461949c84457c735b0000&package=2150917749"
    # }
    return True
